package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/22
 * Time: 下午4:01
 */
public enum TaskTypeEnum {
    INIT(0, "初始化"),
    AUDIT(1, "信审任务"),
    PAY(2, "支付推送任务"),
    COLLECTION(3, "催收推送任务"),
    COLLECTION_PAID_PUSH(4, "金额更新到推送"),
    PRE_REPAYMENT_MSG(5, "到期短信提醒"),
    WITH_HOLD(6, "代扣"),
    SDZZ_DC(7, "闪电周转代偿"),
    SDZZ_PAY_NOTIFY(10, "闪电周转还款回调"),
    SERVICE_FEE_PRE_LOAN(8, "前置收取服务费,发送短信通知"),
    NO_SERVICE_FEE_LOAN_TRADE_CLOSE(9, "支付服务费超时,交易关闭"),
    AUDIT_2(14, "信审任务(二次信审)"),
    GET_FOUND_CODE_RETRY(15, "重试获取资金方code"),
    HIGHMARK_TO_AUDIT(16, "highmark通知信审"),
    CREATE_MIGRATION_ORDER(17, "创建迁移订单"),
    THIRD_ORDER_TO_PAY(18, "三方订单转化为内部审核通过订单支付推送任务"),
    ;

    private int type;
    private String desc;

    TaskTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public TaskTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TaskTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TaskTypeEnum getByType(int type) {
        TaskTypeEnum taskTypeEnum = null;
        for (TaskTypeEnum typeEnum : TaskTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                taskTypeEnum = typeEnum;
                break;
            }
        }

        return taskTypeEnum;
    }
}
